import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUser = defineStore('user', () => {
    const msg = ref('welcome to pinia')

    const reverseMsg = computed(() => msg.value.toUpperCase().split(' ').reverse().join(' ')) 

    function setMsg(newValue) {
      msg.value = newValue
    }

    return { msg, reverseMsg, setMsg }
})